part of '../card.dart';

class _LexicalItemTile extends StatelessWidget {
  const _LexicalItemTile({
    required this.title,
    required this.translation,
    required this.progressInfo,
  });

  final String title;
  final String translation;
  final String progressInfo;

  @override
  Widget build(BuildContext context) {
    final titleText = Text.rich(
      TextSpan(
        children: [
          TextSpan(
            text: title,
            style: CoreTheme.of(context).textTheme.tileBoldTitle,
          ),
          TextSpan(
            text: '  –  $translation',
            style: CoreTheme.of(context).textTheme.tileTitle,
          ),
        ],
      ),
      textWidthBasis: TextWidthBasis.longestLine,
    );

    final leading = SizedBox(
      width: 50,
      child: Center(
        child: Icon(
          CustomRegularIcons.check,
          size: 24,
          color: CoreTheme.of(context).primaryColor,
        ),
      ),
    );

    return UnpressableTextTile(
      titleText: titleText,
      subtitle: progressInfo,
      leading: leading,
    );
  }
}
